import { useState } from "react";

export default function usePagination(getList: (page?: number, size?: number) => void) {
	const [total, setTotal] = useState<number>(0);

	const onChangePage = (page: number) => {
		getList(page, 10);
	};

	return {
		total,
		setTotal,
		onChangePage
	};
}
